<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>concat</title>
  <script>

    /** Array.prototype.concat()方法用于合并两个或多个数组。此方法不会更改现有数组，而是返回一个新数组。 */
    const arr1 = [1, 2, 3];
    const arr2 = [4, 5, 6];
    const mergeArr = arr1.concat(arr2);
    console.log("mergeArr --->", mergeArr); // [1, 2, 3, 4, 5, 6]

    const mergeArr2 = arr1.concat(arr2, ['red'], 'green');
    console.log(mergeArr2); // [1, 2, 3, 4, 5, 6, 'red', 'green']
  </script>
</head>

<body>

</body>

</html>